package com.example.wn.controller;

import com.example.wn.model.vo.common.Result;
import com.example.wn.model.vo.common.ResultCodeEnum;
import com.example.wn.model.vo.system.ValidateCodeVo;
import com.example.wn.service.ValidCodeService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "验证码接口")
@RestController
@RequestMapping(path = "/admin/system/validcode")
public class ValidCodeController {
    @Autowired
    private ValidCodeService validCodeService;

    @Operation(summary = "获取验证码接口")
    @GetMapping("/getValidCode")
    public Result getValidCode(){
        ValidateCodeVo validateCodeVo = validCodeService.getValidCode();
        return Result.build(validateCodeVo, ResultCodeEnum.SUCCESS);
    }
}
